package demo1;

public class Bird extends Animal {
    public String color;
    public Bird() {
        //super();
        System.out.println("调用子类无参构造方法！");
    }

    public Bird(int age, String name) {
        super(age, name);
        //如果没有写super(age, name);则编译器自动生成super();注意：这个没带参数
        System.out.println("调用子类含参构造方法！");
    }

    public Bird(String color) {
        this.color = color;
    }

    public Bird(int age, String name, String color) {
        super(age, name);
        this.color = color;
    }

    public void func() {
        System.out.println(this.name+"可以飞");
    }
}
